package cn.edu.scau.cmi.linzhiyang.singleton;

import java.util.ArrayList;

public class Marshal {
	private String name = null;
	private static ArrayList<Marshal> marshalList = new ArrayList(10);

	private Marshal(String name) {
		this.name = name;
	}

	public static ArrayList<Marshal> getInstance(String name) {
		if (marshalList.size() < 10) {
			Marshal marshal = new Marshal(name);
			marshalList.add(marshal);
			return marshalList;
		} else
			return marshalList;
	}

	public String getName() {
		return name;
	}
}
